// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

using System;
using System.Threading;
using System.Threading.Tasks;

#nullable restore
namespace Elastic.Clients.Elasticsearch.DanglingIndices
{
	public class DanglingIndicesNamespace : NamespacedClientProxy
	{
		internal DanglingIndicesNamespace(ElasticsearchClient client) : base(client)
		{
		}

		public DanglingIndicesListDanglingIndicesResponse ListDanglingIndices(DanglingIndicesListDanglingIndicesRequest request)
		{
			request.BeforeRequest();
			return DoRequest<DanglingIndicesListDanglingIndicesRequest, DanglingIndicesListDanglingIndicesResponse>(request);
		}

		public Task<DanglingIndicesListDanglingIndicesResponse> ListDanglingIndicesAsync(DanglingIndicesListDanglingIndicesRequest request, CancellationToken cancellationToken = default)
		{
			request.BeforeRequest();
			return DoRequestAsync<DanglingIndicesListDanglingIndicesRequest, DanglingIndicesListDanglingIndicesResponse>(request, cancellationToken);
		}

		public DanglingIndicesListDanglingIndicesResponse ListDanglingIndices()
		{
			var descriptor = new DanglingIndicesListDanglingIndicesRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequest<DanglingIndicesListDanglingIndicesRequestDescriptor, DanglingIndicesListDanglingIndicesResponse>(descriptor);
		}

		public DanglingIndicesListDanglingIndicesResponse ListDanglingIndices(Action<DanglingIndicesListDanglingIndicesRequestDescriptor> configureRequest)
		{
			var descriptor = new DanglingIndicesListDanglingIndicesRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<DanglingIndicesListDanglingIndicesRequestDescriptor, DanglingIndicesListDanglingIndicesResponse>(descriptor);
		}

		public Task<DanglingIndicesListDanglingIndicesResponse> ListDanglingIndicesAsync(CancellationToken cancellationToken = default)
		{
			var descriptor = new DanglingIndicesListDanglingIndicesRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequestAsync<DanglingIndicesListDanglingIndicesRequestDescriptor, DanglingIndicesListDanglingIndicesResponse>(descriptor);
		}

		public Task<DanglingIndicesListDanglingIndicesResponse> ListDanglingIndicesAsync(Action<DanglingIndicesListDanglingIndicesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new DanglingIndicesListDanglingIndicesRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<DanglingIndicesListDanglingIndicesRequestDescriptor, DanglingIndicesListDanglingIndicesResponse>(descriptor);
		}
	}
}